// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 登录接口 POST /api/auth/login */
export async function loginApi(body: any, options?: { [key: string]: any }) {
  return request('/api/auth/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取当前的用户 GET /api/auth/info */
export async function getAuthUserApi(body: any, options?: { [key: string]: any }) {
  return request('/api/auth/info', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    params: body,
    ...(options || {}),
  });
}

/** 退出登录接口 POST /admin/auth/logout */
export async function logoutApi(body: any, options?: { [key: string]: any }) {
  return request('/admin/auth/logout', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取当前的用户路由 GET /admin/auth/rules */
export async function getAuthRulesApi(body: any, options?: { [key: string]: any }) {
  return request('/admin/auth/rules', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    params: body,
    ...(options || {}),
  });
}
